home *** CD-ROM | disk | FTP | other *** search
/ CU Amiga Super CD-ROM 17 / CU Amiga Magazine's Super CD-ROM 17 (1997)(EMAP Images)(GB)[!][issue 1997-12].iso / CUCD / Programming / DiceSource / src / dd / hello.c < prev    next >
C/C++ Source or Header  |  1997-09-09  |  1KB  |  55 lines

  1. /*
  2.  *    (c)Copyright 1992-1997 Obvious Implementations Corp.  Redistribution and
  3.  *    use is allowed under the terms of the DICE-LICENSE FILE,
  4.  *    DICE-LICENSE.TXT.
  5.  */
  6.  
  7. #include    <stddef.h>
  8. #include    <stdlib.h>
  9. #include    <stdio.h>
  10. #include    <fcntl.h>
  11. #include        <exec/execbase.h>
  12. #include        <dos/dosextens.h>
  13. #include        <clib/dos_protos.h>
  14. #include        <clib/exec_protos.h>
  15.  
  16. extern void    testfunc(void);
  17.  
  18. typedef struct CommandLineInterface     CLI;
  19. typedef struct Process                  PROCESS;
  20.  
  21.  
  22. extern struct ExecBase                  *SysBase;
  23.  
  24. PROCESS *p;
  25. CLI     *cli;
  26.  
  27. int    main(int ac, char *av[]) 
  28. {
  29.         short   i;
  30. //    char s[256];
  31.         char    *ps;
  32.  
  33.  
  34.         testfunc();
  35. // ******************************************************************************
  36. //        p = (PROCESS *)SysBase->ThisTask;
  37.     p = (struct Process *)FindTask(NULL);
  38. /* this is a comment of
  39.    multi line nature */
  40.         cli = BADDR(p->pr_CLI);
  41.     ps = BADDR(cli->cli_CommandName);
  42.         printf("hello, world\n");
  43.         printf("Command Line = '%s'\n", ps);
  44.         for (i=0; i<ac; i++)
  45.     {
  46.             printf("arg %d = '%s'\n", i, av[i]);
  47.         printf("args printed\n");
  48.     }
  49.     exit(0);
  50. }
  51.  
  52. Abort() {
  53.         exit(0);
  54. }
  55.